/******************************************************************************
 * Copyright 2023 The Apollo Authors. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *****************************************************************************/

#pragma once

#include "modules/canbus_vehicle/x3epro/proto/x3epro.pb.h"
#include "modules/drivers/canbus/can_comm/protocol_data.h"

namespace apollo {
namespace canbus {
namespace x3epro {

class Vcubrakereport47 : public ::apollo::drivers::canbus::ProtocolData<
                    ::apollo::canbus::X3epro> {
 public:
  static const int32_t ID;
  Vcubrakereport47();
  void Parse(const std::uint8_t* bytes, int32_t length,
                     X3epro* chassis) const override;

 private:

    // config detail: {'bit': 0, 'enum': {0: 'BRAKE_ENABLE_RESP_INVALID', 1: 'BRAKE_ENABLE_RESP_VALID'}, 'is_signed_var': False, 'len': 1, 'name': 'Brake_Enable_Resp', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::Brake_enable_respType brake_enable_resp(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 6, 'enum': {0: 'CONTROL_MODE_RESP_STANDBY', 1: 'CONTROL_MODE_RESP_AUTO_DRIVE', 2: 'CONTROL_MODE_RESP_NET_DRIVE', 3: 'CONTROL_MODE_RESP_REMOTE_CONTROL', 4: 'CONTROL_MODE_RESP_EMERGENCY_BRAKE'}, 'is_signed_var': False, 'len': 3, 'name': 'Control_Mode_Resp', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::Control_mode_respType control_mode_resp(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 7, 'enum': {0: 'VCU_REAL_BRAKE_INVALID', 1: 'VCU_REAL_BRAKE_VALID'}, 'is_signed_var': False, 'len': 1, 'name': 'VCU_Real_Brake_Valid', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::Vcu_real_brake_validType vcu_real_brake_valid(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 15, 'is_signed_var': False, 'len': 8, 'name': 'VCU_Real_Brake', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
    int vcu_real_brake(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 11, 'enum': {0: 'AOTOHOLDSWITCHSTATE_OFF', 1: 'AOTOHOLDSWITCHSTATE_ON'}, 'is_signed_var': False, 'len': 1, 'name': 'AotoHoldSwitchState', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::AotoholdswitchstateType aotoholdswitchstate(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 12, 'enum': {0: 'AOTOHOLDWORKSTATUS_INACTIVE', 1: 'AOTOHOLDWORKSTATUS_ACTIVE'}, 'is_signed_var': False, 'len': 1, 'name': 'AotoHoldWorkStatus', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': 'bit', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::AotoholdworkstatusType aotoholdworkstatus(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 18, 'enum': {0: 'VCU_REAL_PARKING_STATUS_EPB_RELEASED', 1: 'VCU_REAL_PARKING_STATUS_EPB_APPLIED', 2: 'VCU_REAL_PARKING_STATUS_EPB_RELEASING', 3: 'VCU_REAL_PARKING_STATUS_EPB_FAULT', 4: 'VCU_REAL_PARKING_STATUS_EPB_APPLYING'}, 'is_signed_var': False, 'len': 3, 'name': 'VCU_Real_Parking_Status', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::Vcu_real_parking_statusType vcu_real_parking_status(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 19, 'enum': {0: 'VCU_REAL_PARKING_INVALID', 1: 'VCU_REAL_PARKING_VALID'}, 'is_signed_var': False, 'len': 1, 'name': 'VCU_Real_Parking_Valid', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::Vcu_real_parking_validType vcu_real_parking_valid(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 20, 'enum': {0: 'RAMPAUXILIARYINDICATION_INACTIVE', 1: 'RAMPAUXILIARYINDICATION_ACTIVE'}, 'is_signed_var': False, 'len': 1, 'name': 'RampAuxiliaryIndication', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::RampauxiliaryindicationType rampauxiliaryindication(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 31, 'is_signed_var': False, 'len': 8, 'name': 'VehicleSlope', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '°', 'precision': 0.1758125, 'type': 'double'}
    double vehicleslope(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 34, 'enum': {0: 'VCU_EHB_BRAKETYPE_NORMAL_BRAKE', 1: 'VCU_EHB_BRAKETYPE_BACKUP_REMOTE_BRAKE', 2: 'VCU_EHB_BRAKETYPE_EMERGENCY_BUTTON_BRAKE', 3: 'VCU_EHB_BRAKETYPE_ULTRASONIC_BRAKE', 4: 'VCU_EHB_BRAKETYPE_BUMPER_BRAKE'}, 'is_signed_var': False, 'len': 3, 'name': 'VCU_EHB_BrakeType', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'enum'}
    Vcu_brake_report_47::Vcu_ehb_braketypeType vcu_ehb_braketype(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 51, 'is_signed_var': False, 'len': 4, 'name': 'VCU_BrakeRept_AliveCounter', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
    int vcu_brakerept_alivecounter(const std::uint8_t* bytes, const int32_t length) const;

    // config detail: {'bit': 63, 'is_signed_var': False, 'len': 8, 'name': 'VCU_BrakeRept_CheckSum', 'offset': 0.0, 'order': 'motorola', 'physical_range': '[0|0]', 'physical_unit': '', 'precision': 1.0, 'type': 'int'}
    int vcu_brakerept_checksum(const std::uint8_t* bytes, const int32_t length) const;
};

}  // namespace x3epro
}  // namespace canbus
}  // namespace apollo


